<?php include 'init.php';?>
<?php 	
	$cates = getCateByPid(0);
	$jbanner = get_config('banner');
	$banner = json_decode($jbanner,true);
	// print_r($banner);
	$sql="SELECT * FROM category";
	$index_cates=$mysql->getAll($sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo get_config('title');?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- Custom Theme files -->
<link href="public/css/bootstrap.css" type="text/css" rel="stylesheet" media="all">
<link href="public/css/style.css" type="text/css" rel="stylesheet" media="all">  
<!-- //Custom Theme files -->
<!-- font-awesome icons -->
<link href="public/css/font-awesome.css" rel="stylesheet"> 
<!-- //font-awesome icons -->
<!-- js -->
<script src="public/js/jquery-2.2.3.min.js"></script> 
<!-- //js -->
<!-- web-fonts --> 
<!-- <link href="//fonts.googleapis.com/css?family=Aladin" rel="stylesheet"> -->
<!-- <link href='//fonts.googleapis.com/css?family=Roboto+Condensed:400,300,300italic,400italic,700,700italic' rel='stylesheet' type='text/css'> -->
<!-- //web-fonts --> 
<!-- start-smooth-scrolling -->
<script type="text/javascript" src="public/js/move-top.js"></script>
<script type="text/javascript" src="public/js/easing.js"></script>	
<script type="text/javascript">
		jQuery(document).ready(function($) {
			$(".scroll").click(function(event){		
				event.preventDefault();
				$('html,body').animate({scrollTop:$(this.hash).offset().top},1000);
			});
		});
</script>
<!-- //end-smooth-scrolling -->
</head>
<body>
	<!-- banner start here -->
	<div class="agileinfo-main">
		<?php include "index_top.php"; ?>
		<!-- navigation start here -->
		<div class="top-nav">
			<span class="menu">Menu</span>	
			<ul class="w3l">
				<li><a class="active" href="index.php"><i aria-hidden="true" class="glyphicon glyphicon-home"></i><span>主页</span></a></li>
				<li><a href="blog.php"><i class="glyphicon glyphicon-list-alt"></i><span>博文排列</span></a></li>
				<li><a href="codes.php"><i class="glyphicon glyphicon-picture"></i><span>博图排列</span></a></li>
				<li><a href="about.php"><i class="glyphicon glyphicon-user"></i><span>关于</span></a></li>
				<li><a href="contact.php"><i class="glyphicon glyphicon-envelope"></i><span>联系</span></a></li>
			</ul>
			<!-- script-for-menu -->
			<script>
			   $( "span.menu" ).click(function() {
				 $( "ul.w3l" ).slideToggle( 300, function() {
				 // Animation complete.
				  });
				 });
			</script>
			<!-- //script-for-menu -->
		</div>	
	</div>
	<!-- navigation end here -->
	<!-- banner end here -->
	<?php include 'view_new_rand.php'; ?>
	<!-- //banner end here --> 
	<!-- welcome -->
	<div class="welcome agileits">
		<div class="container">
			<h2 class="agile-title">欢迎来到我的博客！</h2> 
			<p></p>
			<div class="welcome-agileinfo">
				<div class="col-md-6 col-sm-6 col-xs-6 welcome-grids">
					<a  href="blog.php">
						<div class="view view-w3-agile">
							<img src="public/img/banner/article.jpg" alt="" class="img-responsive" />
							<div class="agileits-w3layouts-mask">
								<h4>点击查看博客文章吧！</h4>
								<p>最有营养的文字让你流连忘返</p>
							</div>
						</div>
					</a>
					
				</div>
				<div class="col-md-6 col-sm-6 col-xs-6 welcome-grids">
					<a href="codes.php">
						<div class="view view-w3-agile">
							<img src="public/img/banner/photo.jpg" alt="" class="img-responsive" />
							<div class="agileits-w3layouts-mask">
								<h4>点我去看图新闻吧！</h4>
								<p>简略的风格并且图文并茂，可不止一目十行哦！</p>
							</div>
						</div>
					</a>
					
				</div>
				<div class="clearfix"> </div>
			</div>
		</div>
	</div>
	<!-- //welcome --> 
	<!-- events -->
	<!-- <div class="events"> 
		<div class="container">
			<h3 class="agile-title">最新活动</h3> 
			<div class="events-info">
				<div class="col-md-6 event-grids">
					<div class="w3layouts-text">
						<h4>10<span>Nov</span></h4>
						<h6><a href="single.html">Sed ut perspiciatis unde omnis </a></h6>
						<div class="clearfix"> </div>
					</div>
					<p>Kasertas lertyasea deeraeser miasera lertasa ritise doloert ferdas caplicabo nerafaes asety u lasec vaserat. nikertyade asetkertyptaiades goertayse.nikertyade asetkertyptaiades goertayse</p>
				</div>
				<div class="col-md-6 event-grids">
					<div class="w3layouts-text">
						<h4>20<span>Dec</span></h4>
						<h6><a href="single.html">Voluptatem accusantium doloremque </a></h6>
						<div class="clearfix"> </div>
					</div>
					<p>Kasertas lertyasea deeraeser miasera lertasa ritise doloert ferdas caplicabo nerafaes asety u lasec vaserat. nikertyade asetkertyptaiades goertayse.nikertyade asetkertyptaiades goertayse</p>
				</div>
				<div class="clearfix"> </div>
			</div>
		</div> 
	</div>  -->
	<!-- //events --> 
	<!--- albums -->
	<div class="albums">
		<div class="container">
			<h3 class="agile-title">热点分类博文</h3> 
			
				<?php foreach ($index_cates as $key => $value) {
					if ($value['name']=='娱乐') { ?>
						<a href="blog.php?cid=<?php echo $value['id']; ?>">
							<div class="col-md-6 w3lsalbums-grid">
								<div class="albums-left"> 
									<div class="wthree-almub">  
									</div>
								</div>
								<div class="albums-right">
									<h4>娱乐八卦</h4>
									<p>娱乐八卦</p>
									<a class="w3more" href="single.html"><i class="fa fa-mail-forward" aria-hidden="true"></i> More</a>
								</div>
								<div class="clearfix"></div>
							</div>
						</a>  
					<?php }
				} ?>
				
				<?php foreach ($index_cates as $key => $value) {
					if ($value['name']=='社会') { ?>
						<a href="blog.php?cid=<?php echo $value['id']; ?>">
							<div class="col-md-6 w3lsalbums-grid">
								<div class="albums-left"> 
									<div class="wthree-almub wthree-almub2"> 
									</div> 
								</div>
								<div class="albums-right">
									<h4>社会杂谈</h4>
									<p>社会杂谈</p>
									<a class="w3more" href="single.html"><i class="fa fa-mail-forward" aria-hidden="true"></i> More</a>
								</div>
								<div class="clearfix"></div>
							</div>  
						</a>  
					<?php }
				} ?>
				
				<?php foreach ($index_cates as $key => $value) {
					if ($value['name']=='体育') { ?>
						<a href="blog.php?cid=<?php echo $value['id']; ?>">
							<div class="col-md-6 w3lsalbums-grid">
								<div class="albums1-right"> 
									<div class="wthree-almub wthree-almub3">  
									</div>
								</div>
								<div class="albums1-left">
									<h4>健身体育</h4>
									<p>健身体育</p>
									<a class="w3more" href="single.html"><i class="fa fa-mail-forward" aria-hidden="true"></i> More</a>
								</div> 
								<div class="clearfix"></div>
							</div>
						</a>  
					<?php }
				} ?>
				
				<?php foreach ($index_cates as $key => $value) {
					if ($value['name']=='军事') { ?>
						<a href="blog.php?cid=<?php echo $value['id']; ?>">
							<div class="col-md-6 w3lsalbums-grid">
								<div class="albums1-right"> 
									<div class="wthree-almub wthree-almub4">  
									</div>
								</div>
								<div class="albums1-left">
									<h4>国防军事</h4>
									<p>国防军事</p>
									<a class="w3more" href="single.html"><i class="fa fa-mail-forward" aria-hidden="true"></i> More</a>
								</div> 
								<div class="clearfix"></div>
							</div>
						</a>  
					<?php }
				} ?>
			<div class="clearfix"></div> 
		</div>
	</div>
	<!--- //albums --> 
	<?php include "footer.php"; ?>
</body>
</html>